package com.example.administrator.familfinalcialmanagement.ui.fragment;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.administrator.familfinalcialmanagement.R;
import com.example.administrator.familfinalcialmanagement.databinding.FragmentMessageBinding;
import com.example.administrator.familfinalcialmanagement.databinding.FragmentReasionBinding;
import com.example.administrator.familfinalcialmanagement.ui.adapter.FriendAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 86178 on 2019/12/4.
 * author mogen
 * 用心，成就一切。
 */
public class MessageFragment extends BaseLazyFragment {

    FragmentMessageBinding binding;
    List<String> list = new ArrayList<>();
    FriendAdapter adapter;


    @Override
    protected View inflaterView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        binding = DataBindingUtil.inflate(LayoutInflater.from(getActivity()), R.layout.fragment_message, container, false);
        binding.setFragment(this);
        return binding.getRoot();
    }


    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        list.clear();
        list.add("");
        list.add("");
        list.add("");
        list.add("");
        list.add("");
        list.add("");

        adapter = new FriendAdapter(getActivity(),list);
        binding.recycler.setLayoutManager(new LinearLayoutManager(getActivity()));
        binding.recycler.setItemAnimator(new DefaultItemAnimator());
        binding.recycler.setAdapter(adapter);

    }

    @Override
    protected void onVisible() {

    }

    @Override
    protected void lazyLoad() {

    }

    @Override
    public int setLayoutId() {
        return R.layout.fragment_message;
    }
}